class Event < ActiveRecord::Base
	has_many :bookings, dependent: :destroy
	has_many :structures, :through => :bookings
	has_many :hd_photos, dependent: :destroy
	
	validates_uniqueness_of :name
	validates :name, presence: true
	validates :date, presence: true
	
	def month
		self.date.month
	end
	
	def formattedDate
		self.date.strftime("%d %b %Y")	
	end
end
